import axios from 'axios'
import qs from 'qs'
const farm = axios.create({
     baseURL: "http://192.168.2.41:39999", 
     timeout: 3000,
     header : {
        'content-type': 'application/x-www-form-urlencoded;charset=utf-8'
        },

})
export function fapi(url,params){
    return new Promise((resolve, reject) => {
        farm({
            url:url,
            params:params
        }).then(res=>{
            resolve(res)
        }).catch(err=>{

            alert("网络失败联系18951223520")
        })

    })

}
export function fapi1(url,params){
    return new Promise((resolve, reject) => {
        farm({
            url:url,
            method:"POST",
            data:qs.stringify(params)
        }).then(res=>{
            resolve(res)
        }).catch(err=>{

            alert("网络失败联系18951223520")
        })

    })

}